<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- 
    JSP Name : da_300_02K.jsp
    Description : 참여 후기 상세(사용자)
    author Ki min
    since 2012. 7. 25.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 7. 25.     Ki min     최초 생성
--%>
<%@ include file="/WEB-INF/jsp/co/us/include/declare.jspf" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
<head>
<title>현대자동차 CSR &#124; 참여후기</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<%@ include file="/WEB-INF/jsp/co/us/include/header.jspf" %>
<script type="text/javascript" src="/dextuploadfl/DEXTUploadFL.js"></script>
<script type="text/javaScript" language="javascript">
$(document).ready(function() {    
    /* form validation check */
    onloadCharCheck();
    
    /* List Page 이동 */
    $("#listButn").bind("click", moveListPage);
    /* Form Submit */
    $("#mdfyButn").bind("click", mdfySubm); 
    /* Form Submit */
    $("#delButn").bind("click", delSubmit); 
});

/*
 * 리스트페이지 이동
 */
function moveListPage() {
    $("#hiddenForm").attr('action','/da_300_01.do').submit();
}

/*
 * 수정 페이지로 이동
 */
function mdfySubm() {
    if (!validateForm($("#mainForm"))) {
        return false;
    }
    
    if (!getPasswordChk1($("#pW").val())) {
        alert("[비밀번호] 는 영문 소/대문자 구분 + 숫자 조합으로 10~12자 입니다.");
        $("#pW").focus();
        return false;
    }
    
    $("#mainForm").attr('target','comIframe');
    $("#mainForm").attr('action','/da_300_07.do');
    $("#mainForm").submit();
}

/*
 * 게시물 삭제
 */
function delSubmit() {
    if (confirm("삭제하시겠습니까?")) {
        $("#delForm").attr('target','comIframe');
        $("#delForm").attr('action','/da_300_08.do').submit();   
    } else {
        return false;
    }
}

/*
 * 이전/다음글 상세페이지로 이동
 */
function moveDtlPage(idx) {
    $("#hiddenForm #blbIdx").val(idx);
    
    $("#hiddenForm").attr('action','/da_300_02.do');
    $("#hiddenForm").submit();
}
</script>
</head>
<body>
<div id="wrap">
    <!-- top -->
    <%@ include file="/WEB-INF/jsp/co/us/include/top.jsp" %>
    <!-- top -->

    <!-- container -->
       <div id="container">
        <div id="contentsWrap">
            <div id="contentsArea">
                <div class="headingArea">
                    <div class="location">
                        <a href="/ma_100_01.do">홈</a>
                        <a href="/da_100_01.do">CSR 자료실</a>
                        <span>참여후기</span>
                    </div>
                    <h2>참여후기</h2>
                </div>
                <div id="contetns">
                    <form id="hiddenForm" name="hiddenForm" method="post">
                        <%-- request --%>
                        <input type="hidden" id="blbIdx" name="blbIdx" value="${result.blbIdx }" />
                        <input type="hidden" id="currentPageNo" name="currentPageNo" value="${rqInfo.currentPageNo }" />
                        <input type="hidden" id="srchScn" name="srchScn" value="${rqInfo.srchScn }" />
                        <input type="hidden" id="srchTxt" name="srchTxt" value="${rqInfo.srchTxt }" />
                    </form>
                    <table border="1" class="tableData review" summary="참여후기의 내용,첨부파일등이 기재 되어있는 표">
                        <col width="20%" />
                        <col width="80%" />
                        <tbody>
                            <tr>
                                <td colspan="2" class="dataView">
                                    <c:choose>
                                        <c:when test="${result.ltrScnCd == 'A'}">
                                      <div class="letterPaper paperType1">
                                        </c:when>
                                        <c:when test="${result.ltrScnCd == 'B'}">
                                      <div class="letterPaper paperType2">
                                        </c:when>
                                        <c:when test="${result.ltrScnCd == 'C'}">
                                      <div class="letterPaper paperType3">
                                        </c:when>
                                    </c:choose>
                                        <!-- editor area -->
                                        <p>
                                        <c:if test="${result.filPath == 'image' && result.filNm != null}">
                                            <img src="/upfile/image/${result.filNm }" alt="" />
                                        </c:if>
                                        <p>
                                        <p><strong>${result.titl}</strong></p>
                                        <p>
                                            ${result.sbc}
                                        </p>
                                        <p style="text-align:right;"><strong>Form. ${result.rgstDt} ${result.pprrNm}</strong></p>
                                        <!--//editor area -->
                                    </div>
                                </td>

                            </tr>
                            <c:if test="${result.filNm != null && result.filPath != 'image'}">
                            <tr>
                                <td class="subThead">첨부파일</td>
                                <td><a href="#" onclick="getUpFileDownload('0050','${result.blbIdx}');return false;" class="attach">${result.filNm}</a></td>
                            </tr>
                            </c:if>
                            <tr>
                                <td class="subThead">다음글</td>
                                <td>
                                <c:choose>
                                    <c:when test="${nextViewResult != null}">
                                        <a href="#none" onclick="moveDtlPage('${nextViewResult.blbIdx}');return false;">${nextViewResult.titl }</a>
                                    </c:when>
                                    <c:otherwise>
                                                                                 다음글이 없습니다.
                                    </c:otherwise>
                                </c:choose>
                                </td>
                            </tr>
                            <tr>
                                <td class="subThead">이전글</td>
                                <td>
                                <c:choose>
                                    <c:when test="${preViewResult != null}">
                                        <a href="#none" onclick="moveDtlPage('${preViewResult.blbIdx}');return false;">${preViewResult.titl }</a>
                                    </c:when>
                                    <c:otherwise>
                                                                                  이전글이 없습니다.
                                    </c:otherwise>
                                </c:choose>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="btnArea down">
                        <span class="flow"><a href="#"  id="listButn" ><img src="/img/usr/btn/btn_list.gif" alt="목록" /></a></span>
                        <span class="reverse">
                            <button type="button" class="layOpenDel"><img src="/img/usr/btn/btn_delete.gif" alt="삭제" /></button>&nbsp;
                            <button type="button" class="layOpen"><img src="/img/usr/btn/btn_modify.gif" alt="수정" /></button>
                        </span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /container -->

    <!-- layer -->
    <div class="layer">
        <div class="mask"></div>
        <div class="layPop">
            <p class="btnClose"><button type="button">close</button></p>
            <div class="noticeModify">
                <p class="msgLayer"><img src="/img/usr/common/msg_layer_notice_mdify.gif" alt="게시물 수정 게시물 작성시 입력한 비밀번호를 입력해 주세요. (영문 소/대문자 구분+숫자 조합으로 10~12자 입니다.)" /></p>
                <div class="userPw">
                    <form id="mainForm" name="mainForm" method="post">
                    <input type="hidden" id="blbIdx" name="blbIdx" value="${result.blbIdx }" />
                    <input type="hidden" id="currentPageNo" name="currentPageNo" value="${rqInfo.currentPageNo }" />
                    <input type="hidden" id="srchScn" name="srchScn" value="${rqInfo.srchScn }" />
                    <input type="hidden" id="srchTxt" name="srchTxt" value="${rqInfo.srchTxt }" />
                    <p><span><img src="/img/usr/common/layer_present_pw.gif" alt="비밀번호" /></span><input type="password" autocomplete='off' id="pW" name="pW" title="비밀번호" nullable="true" minbyte="10" maxbyte="12" maxlength="12" /></p>
                    <p class="confirm"><input id="mdfyButn" type="image" src="/img/usr/btn/btn_layer_confirm_2.gif" title="확인" alt="확인" /></p>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!-- /layer -->
    <!-- delete layer -->
    <div class="layerDel">
        <div class="mask"></div>
        <div class="layPopDel">
            <p class="btnClose"><button type="button">close</button></p>
            <div class="noticeModify">
                <form id="delForm" name="delForm" method="post">
                    <input type="hidden" id="blbIdx" name="blbIdx" value="${result.blbIdx }" />
                    <input type="hidden" id="currentPageNo" name="currentPageNo" value="${rqInfo.currentPageNo }" />
                    <input type="hidden" id="srchScn" name="srchScn" value="${rqInfo.srchScn }" />
                    <input type="hidden" id="srchTxt" name="srchTxt" value="${rqInfo.srchTxt }" />
                <p class="msgLayer"><img src="/img/usr/common/msg_layer_notice_del.gif" alt="게시물 삭제 게시물 작성시 입력한 비밀번호를 입력해 주세요. (영문 소/대문자 구분+숫자 조합으로 10~12자 입니다.)" /></p>
                <div class="userPw">
                    <p><span><img src="/img/usr/common/layer_present_pw.gif" alt="비밀번호" /></span><input type="password" autocomplete='off' id="pW" name="pW" title="비밀번호" nullable="true" minbyte="10" maxbyte="12" maxlength="12" /></p>
                    <p class="confirm"><input id="delButn" type="image" src="/img/usr/btn/btn_layer_confirm_2.gif" title="확인" alt="확인" /></p>
                </div>
                </form>
            </div>
        </div>
    </div>
    <!-- /delete layer -->
    

    <!-- footer -->
    <%@ include file="/WEB-INF/jsp/co/us/include/bottom.jsp" %>
    <!-- /footer -->
</div>
</body>
</html>